package com.example.demo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.demo.model.entity.ApplyEntity;
import com.example.demo.model.entity.NewsEntity;
import com.example.demo.model.param.ApplyParam;
import com.example.demo.model.param.NewsParam;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface NewsMapper extends BaseMapper<NewsEntity> {



    @Select("<script>select * from t_news where 1 = 1 <when test='param.status != null and param.status != -1'> and status = #{param.status}</when><when test= 'param.title != null and param.title !=\"\"'>and title = #{param.title}</when></script>")
    List<NewsEntity> selectNewsList(@Param("param") NewsParam newsParam);
}
